'use strict';
module.exports = {
	/**
	 * XXXnameXXX
	 * @url api/pub/test 前端调用的url参数地址
	 * data 请求参数
	 * @param {String} params1  参数1
	 */
	main: async (event) => {
		let {
			data = {}, userInfo, util, filterResponse, originalParam
		} = event;
		let {
			customUtil,
			uniID,
			config,
			pubFun,
			vk,
			db,
			_
		} = util;
		let {
			uid,
			js_code
		} = data;
		let res = {
			code: 0,
			msg: ""
		};
		// 业务逻辑开始-----------------------------------------------------------
		// let access_token = await vk.openapi.weixin.auth.getAccessToken({
		// 	appid: "wx06f6d4d34d8eb4f0",
		// 	appsecret: "ae4e030858e5903e1d8c3567e0ad2d4b"
		// });
		// let apiUrl =
		// 	"https://api.weixin.qq.com/wxadrama/bindaccount?access_token="+access_token
		// let update_res = await uniCloud.httpclient.request(apiUrl, {
		// 	method: 'POST',
		// 	data: {
		// 		"appid":"wx06f6d4d34d8eb4f0",
		// 		"bind_type":1,
		// 	},
		// 	contentType: 'json', // 指定以application/json发送data内的数据
		// 	dataType: 'json' // 指定返回值为json格式，自动进行parse
		// })
		// console.log("update_res=",update_res);
		
		let LogService = vk.require("service/api/util/pubFunction");
		await LogService.init(util)
		let log = await LogService.test({
			type: "删除",
			context: originalParam.context
		});
		console.log("log", log);
		// 业务逻辑结束-----------------------------------------------------------
		return res;
	}
}